<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        //如何获取一个字符串中的数字字符， 并按数组形式输出，
        //如dgfhfgh254bhku289fgdhdy675gfh输出[254, 289, 675];.

        let str="dgfhfgh254bhku289fgdhdy675gfh";
        let regExp=/\d+/g;
        console.log(str.match(regExp));
    </script>
</body>

</html>